import { _decorator, Component, EventKeyboard, Input, input, KeyCode, Node, Vec2 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('PlayerController')
export class PlayerController extends Component {

    velocity: Vec2 = new Vec2(0, 0);

    isMove: boolean = true;


    start() {

    }

    update(deltaTime: number) {
        if (this.isMove) {
            this.node.setPosition(
                this.node.position.x + this.velocity.x,
                this.node.position.y + this.velocity.y
            )
        }
    }
}


